package com.uuah.server.api.component;

import com.uuah.api.config.object.IObjectFactory;
import com.uuah.api.lifecycle.ILifecycle;
import com.uuah.server.api.IUuahEvent;
import com.uuah.server.api.IUuahMessage;
import com.uuah.server.api.component.model.IEntryPointResolverSet;
import com.uuah.server.api.component.service.IService;
import com.uuah.server.exception.AbstractUuahServerException;

/**
 *
 * TODO comment ...
 *
 * <p>
 * update record:updator，update time，update content and version
 * </p>
 *
 * @author <a href="jonny_quan@hotmail.com">jonny</a>
 * @date 2009 2009-3-26 下午11:39:19
 * @version 1.0.0
 */
public interface IComponent extends ILifecycle {
	/**

	 *
	 * @param event
	 *            the event used to invoke the component
	 * @return the return event from the component
	 * @throws AbstractUuahServerException
	 *             if the call fails
	 */
	IUuahMessage invoke(IUuahEvent event) throws AbstractUuahServerException;

	/**
	 *
	 * @param service
	 */
	void setService(IService service);

	/**
	 *
	 * @return
	 */
	IService getService();

	/**
	 *
	 * @return Null is a resolver set has not been set otherwise the resolver to
	 *         use on this service
	 */
	IEntryPointResolverSet getEntryPointResolverSet();

	/**
	 *
	 * @return Null is a resolver set has not been set otherwise the resolver to
	 *         use on this service
	 */
	void setEntryPointResolverSet(IEntryPointResolverSet entryPointResolverSet);

	/**
	 *
	 * @param objectFactory
	 */
	void setObjectFactory(IObjectFactory objectFactory);

	/**
	 *
	 * @return
	 */
	IObjectFactory getObjectFactory();

	/**
	 *
	 * @return
	 */
	Class getObjectType();

	/**
	 *
	 * @return
	 */
	ILifecycleAdapterFactory getLifecycleAdapterFactory();

	/**
	 *
	 * @param lifecycleAdaptor
	 */
	void setLifecycleAdapterFactory(ILifecycleAdapterFactory lifecycleAdaptor);
}
